<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>新增回复</title>
<%@include file="../collect/meta.jsp"%>
<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
<link rel="stylesheet" href="css/Inputstyle.css" type="text/css"></link>
<link rel="stylesheet" href="css/reply.css" type="text/css"></link>
<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
</head>
<body lang="zh-cn">
	<div class="wrapper">
		<c:import url="/collect/top.jsp"></c:import>
		<div class="main-container" id="main-container">
			<div class="main-container-inner">
				<c:import url="/collect/left.jsp"></c:import>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<ul class="breadcrumb">
							<li><i class="icon-home home-icon"></i>微信管理</li>
							<li>自动回复管理</li>
							<li><a href="reply!watchReply">设置回复</a>
							</li>
							<li>新增回复</li>
						</ul>
						<!-- .breadcrumb -->
					</div>
					<div class="page-content">
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<form action="reply!addReply" name="addReply" method="post">
									<div align="center">
										<div class="title">
											<label for="one">标题:&nbsp;</label> 
											<input type="text" class="input"
												id="one" name="reply.title" />
											<div id="content" class="cont1"></div>
										</div>
										<div class="text">
											<label>回复内容:&nbsp;</label>
											<textarea cols="22" rows="6" id="two" name="reply.content"></textarea>
											<div id="contenttwo" class="cont2"></div>
										</div>
										<!-- <div align="left" id="two"></div> -->
										<div id="btn-team">
											<input type="button" class="btn btn-primary radius" id="but"
												value="添加" /> <a class="btn btn-primary radius"
												href="reply!watchReply">返回</a>
										</div>
									</div>
								</form>
								<!-- PAGE CONTENT ENDS -->
							</div>
							<!-- /.col -->
						</div>
						<!-- /.row -->
					</div>
					<!-- /.page-content -->
				</div>
				<!-- /.main-content -->
			</div>
			<!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up"
				class="btn-scroll-up btn btn-sm btn-inverse"
				style="position:fixed;bottom:0;"> <i
				class="icon-double-angle-up icon-only bigger-110"></i> </a>
		</div>
		<!-- /.main-container -->
		<div class="push"></div>
	</div>
	<c:import url="/collect/down.jsp"></c:import>

	<!--  -->
	<script type="text/javascript">
		$(document).ready(
				function() {
					//var nu = /\s/;
					//var str = /[\ |\~|\`|\@|\#|\$|\%|\^|\&|\||\\|\[|\]|\{|\}|\"|\'|\<|\>|\/]/;
					$("input[id='one']").focus(function() {
						$(this).addClass("tbinput");
						$("div[id='content']").html("");
					});
					$("input[id='one']").blur(
							function() {
								$(this).removeClass("tbinput");
								var one = $(this).val();

								if (one.length == 0) {
									$("div[id='content']").html("必填")
											.removeClass("success").addClass(
													"error");
									return false;
								}

								$("div[id='content']").html("确认")
										.removeClass("error").addClass(
												"success");

							});
					$("textarea[id='two']").focus(function() {
						$(this).addClass("tbinput");
						$("div[id='contenttwo']").html("");
					});
					$("textarea[id='two']").blur(
							function() {
								$(this).removeClass("tbinput");
								var one = $(this).val();
								if (one.length == 0) {
									$("div[id='contenttwo']").html("必填")
											.removeClass("success").addClass(
													"error");
									return false;
								}

								$("div[id='contenttwo']").html("确认")
										.removeClass("error").addClass(
												"success");

							});
					$("#but").click(function() {
						var one = $("div[id='content']").text();
						var two = $("div[id='contenttwo']").text();

						if (one == "确认" && two == "确认") {
							$("form[name='addReply']").submit();
							alert("添加成功");
						} else {
							alert("请完善以上信息");
							return false;
						}
					});
				});
		//防dropmenu刷新收回;查看回复：$设置回复新增回复
		$(document).ready(function() {
			$('.weixinguanli > ul').show();
			$('.autoanswer > ul').show();
			$('.autoanswer > ul > li a').eq(0).css("color", "red");
		});
	</script>
</body>
</html>